/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.ipo.mm.ejb.facade.family;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.ipo.mm.ejb.entities.InstitutionFamily;

/**
 *
 * @author makcro
 */
@Stateless
public class InstitutionFamilyFacade implements InstitutionFamilyFacadeLocal, InstitutionFamilyFacadeRemote {
    @PersistenceContext
    private EntityManager em;

    public void create(InstitutionFamily institutionFamily) {
        em.persist(institutionFamily);
    }

    public void edit(InstitutionFamily institutionFamily) {
        em.merge(institutionFamily);
    }

    public void remove(InstitutionFamily institutionFamily) {
        em.remove(em.merge(institutionFamily));
    }

    public InstitutionFamily find(Object id) {
        return em.find(InstitutionFamily.class, id);
    }

    public List<InstitutionFamily> findAll() {
        return em.createNamedQuery("InstitutionFamily.findAll").getResultList();
    }

}
